{{ header }}
<div id="product-category" class="container">
  {% include helper.template('_share/breads') %}
  <div class="row">{{ column_left }}
    {% if column_left and column_right %}
    {% set class = 'col-sm-6' %}
    {% elseif column_left or column_right %}
    {% set class = 'col-sm-9' %}
    {% else %}
    {% set class = 'col-sm-12' %}
    {% endif %}
    <div id="content" class="{{ class }}">{{ content_top }}
      <h2>{{ heading_title }}</h2>
      {% if categories %}
      {% if categories|length <= 5 %}
      <div class="row more-category">
        <div class="col-sm-3">
          <ul>
            {% for category in categories %}
            <li><a href="{{ category.href }}">{{ category.title }}</a></li>
            {% endfor %}
          </ul>
        </div>
      </div>
      {% else %}
      <div class="row more-category">{% for category in categories|batch((categories|length / 4)|round(1, 'ceil')) %}
        <div class="col-sm-3">
          <ul>
            {% for child in category %}
            <li><a href="{{ child.href }}">{{ child.title }}</a></li>
            {% endfor %}
          </ul>
        </div>
        {% endfor %}</div>
      <br />
      {% endif %}
      {% endif %}
      {% if products %}
      <div class="row">
        <div class="col-sm-12">
          <div class="list-grid">
            <div class="col-md-2 col-sm-6 grid-out hidden-xs">
              <div class="btn-group btn-group-sm">
                <button type="button" id="list-view" class="btn btn-default" data-toggle="tooltip" title="{{ button_list }}"><i class="fa fa-th-list"></i></button>
                <button type="button" id="grid-view" class="btn btn-default" data-toggle="tooltip" title="{{ button_grid }}"><i class="fa fa-th"></i></button>
              </div>
            </div>
            <div class="col-md-3 col-sm-6 grid-out">
              <div class="form-group category-compare"><a href="{{ compare }}" id="compare-total">{{ text_compare }}</a></div>
            </div>
            <div class="col-md-4 col-xs-6 grid-out">
              <div class="form-group input-group input-group-sm category-group">
                <label class="input-group-addon" for="input-sort">{{ text_sort }}</label>
                <select id="input-sort" class="form-control" onchange="location = this.value;">
                  {% for sorts in sorts %}
                    {% if sorts.value == '%s-%s'|format(sort, order) %}
                      <option value="{{ sorts.href }}" selected="selected">{{ sorts.text }}</option>
                    {% else %}
                      <option value="{{ sorts.href }}">{{ sorts.text }}</option>
                    {% endif %}
                  {% endfor %}
                </select>
              </div>
            </div>
            <div class="col-md-3 col-xs-6 grid-out">
              <div class="form-group input-group input-group-sm category-group">
                <label class="input-group-addon" for="input-limit">{{ text_limit }}</label>
                <select id="input-limit" class="form-control" onchange="location = this.value;">



                  {% for limits in limits %}
                    {% if limits.value == limit %}



                      <option value="{{ limits.href }}" selected="selected">{{ limits.text }}</option>



                    {% else %}



                      <option value="{{ limits.href }}">{{ limits.text }}</option>



                    {% endif %}
                  {% endfor %}



                </select>
              </div>
            </div>
            <div class="clearfix"></div>
          </div>
        </div>
      </div>
      <div class="row">
        {% for product in products %}
          {% include helper.template('_share/list_product') %}
        {% endfor %}
      </div>
      <div class="row">
        <div class="col-sm-6 text-left">{{ pagination }}</div>
        <div class="col-sm-6 text-right">{{ results }}</div>
      </div>
      {% endif %}
      {% if not categories and not products %}
      <p>{{ text_empty }}</p>
      <div class="buttons">
        <div class="pull-right"><a href="{{ continue }}" class="btn btn-primary">{{ button_continue }}</a></div>
      </div>
      {% endif %}
      {{ content_bottom }}</div>
    {{ column_right }}</div>
</div>
{{ footer }} 
